/**
 * Alipay.com Inc.
 * Copyright (c) 2004-2014 All Rights Reserved.
 */
package com.lshtv.service;

import org.springframework.beans.factory.annotation.Autowired;

import com.lshtv.base.ArticleQuery;
import com.lshtv.base.PageList;
import com.lshtv.dao.ArticleDAO;
import com.lshtv.model.Article;

/**
 * 
 * @author danjingyu
 * @version $Id: ArticleQueryFacadeImpl.java, v 0.1 2014-3-11 下午11:43:48 danjingyu Exp $
 */
public class ArticleQueryFacadeImpl implements ArticleQueryFacade {

    @Autowired
    private ArticleDAO articleDAO;

    /** 
     * @see com.lshtv.service.ArticleQueryFacade#selectById(int)
     */
    public Article selectById(int id) {
        return articleDAO.findById(id);
    }

    /** 
     * @see com.lshtv.service.ArticleQueryFacade#queryByPage(int, int, java.lang.String, java.lang.String)
     */
    public PageList<Article> queryByPage(ArticleQuery query) {
        return articleDAO.findPage(query.getPageNo(), query.getPageSize(), query.getReadOnly(),
            query.getName());
    }

    public void setArticleDAO(ArticleDAO articleDAO) {
        this.articleDAO = articleDAO;
    }

}
